import static org.junit.Assert.*; 
import org.junit.After;
import org.junit.Before;
import org.junit.Test;



/**
* @author Irina
*
*/
public class RecipeTest {

private CoffeeMaker cm;
private Inventory i;
private Recipe r2;
private Recipe r1;

@Before
public void setUp() throws Exception {
cm = new CoffeeMaker();
i = new Inventory();
r1 = new Recipe();

r1.setName("Coffee");
r1.setPrice(50);
r1.setAmtCoffee(6);
r1.setAmtMilk(1);
r1.setAmtSugar(1);
r1.setAmtChocolate(0);
r2 = new Recipe();
r2.setName("Chocolate");
r2.setPrice(20);
r2.setAmtCoffee(0);
r2.setAmtMilk(2);
r2.setAmtSugar(2);
r2.setAmtChocolate(2);
}

/**
* @throws java.lang.Exception
*/
@After
public void tearDown() throws Exception {
}

/**
* Test method for getAmtChocolate
*/
@Test
public void testGetAmtChocolate() {
r2.setAmtChocolate(2);
assertEquals(2,r2.getAmtChocolate());
}

/**
* Test method for AmtChocolate
*/
@Test
public void testSetAmtChocolate() {
r2.setAmtChocolate(1);
assertEquals(1,r2.getAmtChocolate());
}
/* // tests invalid amount
@Test
public void testGetChocolate_invalid() {
r2.setAmtChocolate(1);
assertEquals(50,r2.getAmtChocolate());
}*/

/**
* Test method for getAmtCoffee
*/
@Test
public void testGetAmtCoffee() {
r2.setAmtCoffee(1);
assertEquals(1,r2.getAmtCoffee());
}

/**
* Test method for AmtCoffee
*/
@Test
public void testSetAmtCoffee() {
r2.setAmtCoffee(2);
assertEquals(2,r2.getAmtCoffee());
}

/**
* Test method for getAmtMilk
*/
@Test
public void testGetAmtMilk() {
r2.setAmtMilk(1);
assertEquals(1,r2.getAmtMilk());
}

/**
* Test method for AmtMilk
*/
@Test
public void testSetAmtMilk() {
r2.setAmtMilk(2);
assertEquals(2,r2.getAmtMilk());
}

/**
* Test method for AmtSugar
*/
@Test
public void testGetAmtSugar() {
r2.setAmtSugar(1);
assertEquals(1,r2.getAmtSugar());
}

/**
* Test method for AmtSugar
*/
@Test
public void testSetAmtSugar() {
r2.setAmtSugar(2);
assertEquals(2,r2.getAmtSugar());
}

/**
* Test method for getName
*/
@Test
public void testGetName() {
r2.setName("Chocolate");
assertEquals("Chocolate",r2.getName());
}
// tests invalid name
@Test
public void testGetName_invalid() {
r2.setName("Chocolate");
assertEquals("Cocoa",r2.getName());
}

/**
* Test method for setName
*/
@Test
public void testSetName() {
r2.setName("Chocolate");
assertEquals("Chocolate",r2.getName());
}

/**
* Test method for getPrice
*/
@Test
public void testGetPrice() {
r2.setPrice(10);
assertEquals(10,r2.getPrice());
}

/**
* Test method for setPrice
*/
@Test
public void testSetPrice() {
r2.setPrice(10);
assertEquals(10,r2.getPrice());
}

/**
* Test method for Recipe equals
*/
@Test
public void testEqualsRecipe_r2() {
r2.equals(r2);
assertEquals("Chocolate",r2.getName());
}

/**
* Test method for RecipetoString
*/
@Test
public void testToString_r2() {
r2.setName("Chocolate");
assertEquals("Chocolate",r2.toString());
}
}
